<template>
  <el-container id="info">
    <el-header class="navigation">
      <div class="logo">
        <img id="logo" src="../../assets/Logo.jpeg" alt="" />
        <h3 style="color: white">四川省志愿填报系统</h3>
      </div>
      <div class="exit">
        <router-link to="/">返回首页</router-link>
      </div>
    </el-header>
    <el-container class="content">
      <el-aside width="200px">
        <el-menu router background-color="rgba(0, 21, 41)">
          <router-link
            :to="item.route"
            v-for="(item, index) in navList"
            :key="index"
          >
            <el-menu-item
              :style="{
                color: activePath === index ? 'rgba(255,101,0)' : 'white',
              }"
            >
              <span slot="title" @click="change(index)">{{ item.name }}</span>
            </el-menu-item>
          </router-link>
        </el-menu>
      </el-aside>
      <el-main class="rightContent">
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  name: "info",
  data() {
    return {
      navList: [
        {
          route: "/home/info",
          name: "个人信息",
        },
        {
          route: "/home/voluntaryForm",
          name: "我的志愿表",
        },
        {
          route: "/home/collegeCollection",
          name: "我的收藏院校",
        },
      ],
      // 是否切换样式
      activePath: 0,
    };
  },
  methods: {
    // 切换样式 跳转
    change(index) {
      this.activePath = index;
    },
  },
};
</script>

<style scoped>
* {
  padding: 0;
  margin: 0;
}

.el-container {
  min-height: 92.7vh;
  background-color: rgba(0, 21, 41);
}

#info {
  display: flex;
  flex-direction: column;
  font-size: 16px;
}

.navigation {
  z-index: 999;
  position: relative;
  width: 100%;
  height: 60px;
  background-color: rgba(0, 21, 41);
}

.hashFixed {
  position: fixed;
  top: 0;
  z-index: 999;
}

.navigation-active {
  position: fixed;
  top: 0;
}

.logo {
  float: left;
  width: 250px;
  height: 100%;
  margin-left: 50px;
}

#logo {
  float: left;
  width: 35px;
  height: 35px;
  margin-top: 12.5px;
}

.logo h3 {
  margin-left: 15px;
  float: left;
  height: 60px;
  line-height: 60px;
  text-align: center;
}

.exit {
  position: absolute;
  right: 20px;
  top: 15px;
  width: 100px;
  height: 30px;
  line-height: 30px;
  text-align: center;
}

.exit a {
  color: white;
}

.exit a:hover {
  color: rgba(255, 101, 0);
}

.el-aside {
  background-color: #001529;
  height: 100%;
}

.el-aside .el-menu {
  margin-top: 30px;
  border: none;
}

.el-menu-item {
  margin-bottom: 10px;
  width: 100%;
  text-align: center;
}

.el-menu span {
  font-size: 16px;
}

.el-main {
  background-color: #eaedf1;
}

.rightContent {
  background-color: rgba(240, 242, 245);
}
</style>